<template>
  <div class="time">
    <fx-time-picker v-model="picker"></fx-time-picker>
    {{ picker }}
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, watch } from 'vue'
import { dateFormat } from '@/base/utils'

export default defineComponent({
  name: 'viewTime',
  setup () {
    const picker = ref([new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)])
    watch(picker, (val: Date[]) => {
      console.log(dateFormat('YYYY-MM-DD hh:mm:ss', val[0]), dateFormat('YYYY-MM-DD hh:mm:ss', val[1]))
    }, { deep: true })

    return {
      picker
    }
  }
})
</script>

<style scoped lang="scss">
.time {
}
</style>
